#include<iostream>
using namespace std;
#include<vector>
#include<unordered_set>
class Solution {
public:
    vector<string> findRepeatedDnaSequences(string s) {
        unordered_set<string> ma, a;
        vector<string> ans;
        for (int left = 0, right = 9; right < s.size(); ++right) {
            string now = { s.begin() + left,s.begin() + right + 1 };
            if (ma.count(now) && a.count(now) == 0) {
                ans.push_back(now);
                a.insert(now);
            }
            ma.insert(now);
            ++left;
        }
        return ans;
    }
};